package com.dhcc.model;

import javax.persistence.*;

/**
 * Created by guorui on 2017/3/17.
 */
@Entity
@Table(name = "tb_testplan", schema = "test", catalog = "")
public class Testplan {
    private int planId;
    private String planTitle;
    private String planTime;
    private int userId;

    @Id
    @Column(name = "plan_id", nullable = false)
    public int getPlanId() {
        return planId;
    }

    public void setPlanId(int planId) {
        this.planId = planId;
    }

    @Basic
    @Column(name = "plan_title", nullable = false, length = 50)
    public String getPlanTitle() {
        return planTitle;
    }

    public void setPlanTitle(String planTitle) {
        this.planTitle = planTitle;
    }

    @Basic
    @Column(name = "plan_time", nullable = false, length = 30)
    public String getPlanTime() {
        return planTime;
    }

    public void setPlanTime(String planTime) {
        this.planTime = planTime;
    }

    @Basic
    @Column(name = "user_id", nullable = false)
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Testplan testplan = (Testplan) o;

        if (planId != testplan.planId) return false;
        if (userId != testplan.userId) return false;
        if (planTitle != null ? !planTitle.equals(testplan.planTitle) : testplan.planTitle != null) return false;
        if (planTime != null ? !planTime.equals(testplan.planTime) : testplan.planTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = planId;
        result = 31 * result + (planTitle != null ? planTitle.hashCode() : 0);
        result = 31 * result + (planTime != null ? planTime.hashCode() : 0);
        result = 31 * result + userId;
        return result;
    }
}
